Page({

  data: {
    reportUrl: null,
    reportShow: false,
  },


  onLoad: function (options) {
    wx.showLoading({
      title: '加载中',
    })
    var that = this
    var params = options.url;
    that.setData({
      reportUrl: params 
    })
    that.setData({
      reportShow: false
    })
    wx.downloadFile({
      url: that.data.reportUrl,
      success: function (res) {
        var Path = res.tempFilePath
        wx.openDocument({
          filePath: Path,
          showMenu: true,	
          fileType: "pdf",
          success: function (res) {
            wx.hideLoading()
          }
        })
        setTimeout(function () {
          wx.hideLoading()
        }, 2000)
      },
      fail: function (res) {
        console.log(res);
      }
    })
  },
  onHide:function(){
    wx.navigateBack()
  },

})